import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

// 样式重置
import "normalize.css/normalize.css";
// icon
import "@/assets/icon/iconfont.css";
// 全局样式
import "@/styles/index.scss";
// 守卫
import "@/permission";

// import "default-passive-events";

// 全局注册组件
import mComp from "./components/index.js";
Vue.use(mComp);

Vue.config.productionTip = false;

import hasPermission from "@/directive/permission";
Vue.use(hasPermission);

/**
 * 生产环境使用 mock
 */

if (process.env.NODE_ENV === "development") {
  const { mockXHR } = require("../mock");
  mockXHR();
}
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

import "@/icons"; // icon

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount("#app");
